package com.gjzt.business.publish.controller;

import net.sf.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.eastdigit.servlet.RequestAttribute;
import com.eastdigit.servlet.Response;
import com.eastdigit.servlet.ReqBean;
import com.gjzt.business.publish.service.PublishBillDetailService;

@Controller
@RequestMapping(value = "/billDetail")
public class PublishBillDetailController {

    @Autowired
    private PublishBillDetailService publishBillDetailService;

    /**
     * 查询
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/query")
    @ResponseBody
    public JSONObject queryAdPublishBillDetail(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        return Response.response(publishBillDetailService.findAdPublishBillDetail(reqBean));
    }

    /**
     * 查询
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/queryDetails")
    @ResponseBody
    public JSONObject queryDetails(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        return Response.response(publishBillDetailService.queryDetails(reqBean));
    }

    /**
     * 添加
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/add")
    @ResponseBody
    public JSONObject addAdPublishBillDetail(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        publishBillDetailService.addAdPublishBillDetail(reqBean);
        return Response.responseSuccess();
    }

    /**
     * 修改
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/update")
    @ResponseBody
    public JSONObject updateAdPublishBillDetail(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        publishBillDetailService.updateAdPublishBillDetail(reqBean);
        return Response.responseSuccess();
    }

    /**
     * 删除
     *
     * @param reqBean
     * @return
     */
    @RequestMapping(value = "/delete")
    @ResponseBody
    public JSONObject removeAdPublishBillDetail(final @RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
        publishBillDetailService.removeAdPublishBillDetail(reqBean);
        return Response.responseSuccess();
    }

    //TODO 其他功能
}